package com.gopay.common.cps.dao.order.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseReadDAOImpl;
import com.gopay.common.cps.dao.order.CpsGeneralPayOrderQueryDAO;
import com.gopay.common.domain.cps.CpsGenPayOrder;

/**
 * 付款类订单明细表DAO
 * 
 * @CpsGeneralPayOrderQueryDAOImpl.java
 * @author GongZhong
 * @2013-3-18 下午04:01:07 www.gopay.com.cn Inc.All rights reserved.
 */

@Repository(value = "cpsGenPayOrderQueryDAO")
public class CpsGeneralPayOrderQueryDAOImpl extends BaseReadDAOImpl<CpsGenPayOrder, Serializable> implements
        CpsGeneralPayOrderQueryDAO {

	@Override
	public CpsGenPayOrder findByGopayOrderId(String gopayOrderId) {
		String hql = " select m from CpsGenPayOrder m where m.gopayOrderId = '"
				+ gopayOrderId + "'";
		List<CpsGenPayOrder> ss = findByHql(hql);
		return (null == ss || 0 == ss.size()) ? null : ss.get(0);
	}
}
